package com.wtwd.device.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wtwd.device.dao.AppVersionMapper;
import com.wtwd.device.model.entity.AppVersion;
import com.wtwd.device.model.vo.AppVersionVo;
import com.wtwd.device.service.AppVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author mjy
 * @date 2021/11/09
 * @description
 */
@Service
public class AppVersionServiceImpl implements AppVersionService {


    @Autowired
    private AppVersionMapper appVersionMapper;


    @Override
    public IPage<AppVersionVo> getPageAppVersionByLikeNameNotInType(String appName, Integer type,Page<Object> page) {
        return appVersionMapper.getPageAppVersionByLikeNameNotInType(appName,type,page);
    }

    @Override
    public List<AppVersion> getAppVersionByConditions(AppVersion searchVersion) {
        return appVersionMapper.getAppVersionByConditions(searchVersion);
    }

    @Override
    public Integer addAppVersion(AppVersion appVersion) {
        appVersion.setUpdateTime(0L);
        return appVersionMapper.addAppVersion(appVersion);
    }

    @Override
    public Integer updateAppVersion(AppVersion appVersion) {
        return appVersionMapper.updateAppVersion(appVersion);
}

    @Override
    public Integer bathAddAppVersion(ArrayList<AppVersion> appVersions) {
        return appVersionMapper.bathAddAppVersion(appVersions);
    }
}
